package com.example.zzh.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.zzh.entity.ZzhProduct;
import com.example.zzh.entity.ZzhProductInfo;
import com.example.zzh.mapper.ZzhProductMapper;
import com.example.zzh.service.ZzhProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;

/**
 * <p>
 * 产品表 服务实现类
 * </p>
 *
 * @author zzh
 * @since 2023-08-13
 */
@Service
public class ZzhProductServiceImpl extends ServiceImpl<ZzhProductMapper, ZzhProduct> implements ZzhProductService {
    @Resource
    private ZzhProductMapper zzhProductMapper;

    @Override
    public IPage pageName(Page<ZzhProduct> page) {
        return zzhProductMapper.pageName(page);
    }

    @Override
    public IPage pageNames(Page<ZzhProduct> page, Wrapper wrapper) {
        return zzhProductMapper.pageNames(page,wrapper);
    }

    @Override
    public ZzhProduct getProductById(Long id) {
        return zzhProductMapper.selectById(id);
    }

    @Override
    public Long saveProduct(ZzhProduct zzhProduct) {
        return zzhProductMapper.saveProduct(zzhProduct);
    }

    @Override
    public List<ZzhProductInfo> selectProductList(Page<ZzhProduct> page, HashMap<String, Object> hashMap) {
        return zzhProductMapper.selectProductList(page,hashMap);
    }
}
